home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Developer Utilities / Installer 4.0.3 SDK / Script Examples / Folder Merge [infm] Example / myFolderMrg.r < prev    next >
Encoding:
Text File  |  1994-11-15  |  7.8 KB  |  269 lines  |  [TEXT/MPS ]

  1. //
  2. //    myFolderMrg.r
  3. //
  4. //        This installer script source demonstrates use of 
  5. //        the 'folder' or 'folder merge' atom ( 'infm' ).
  6. //        
  7. //        The advantage to using a folder merge atom within
  8. //        your installer script is that once the script has
  9. //        been completed, the actual contents of the folder
  10. //        described by the folder merge atom can change, and
  11. //        no changes are needed in the Installer source script.
  12. //        Whatever files are contained in the folder will
  13. //        automatically be included. You must however run
  14. //        ScriptCheck on the source script so that the Installer
  15. //        will know the actual size of the folder to be installed.
  16. //
  17. //        Use of the "folder-user:" path is supported allowing users
  18. //        to select the target path for the files contained in the
  19. //        folder.
  20. //
  21. //        Use of the "special-xxxx" paths for installing files to
  22. //        the user's system folder is not currently supported.
  23. //
  24. //        Use of InstaCompOne compression is not currently supported
  25. //        for use with folder merge atoms.
  26. //
  27. //        NOTE: As of Installer 4.0.3 the feature allowing the scriptwriter
  28. //        to implement installation of a Custom Icon is broken. Currently
  29. //        the Installer fails to set the "use Custom Icon" bit in the
  30. //        Finder Attributes flag of the target folder. I have included
  31. //        an example of installing an icon file anyway, so that when this
  32. //        problem is fixed, those who would like to implement it will have
  33. //        the information necessary. An 'after' Action Atom can be used to work 
  34. //        around this bug.  Contact DTS (AL: DEV.SUPPORT) for more information.
  35. //
  36. //
  37. //        mark young • 08/20/94
  38. //    
  39. //        Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
  40. //
  41.  
  42. #include "InstallerTypes.r"
  43.  
  44.  
  45. // • packages
  46.  
  47. resource 'inpk' (100) {
  48.     format0 {
  49.         showsOnCustom,
  50.         removable,
  51.         dontForceRestart,
  52.         0,
  53.         0,
  54.         "Folder Merge to \"FolderMerge Example:\" folder",
  55.         {    
  56.         'infm', 1000;
  57.         },
  58.     }
  59. };
  60.  
  61. resource 'inpk' (200) {
  62.     format0 {
  63.         showsOnCustom,
  64.         removable,
  65.         dontForceRestart,
  66.         0,
  67.         0,
  68.         "Folder Merge to User Selected folder",
  69.         {    
  70.         'infm', 2000;
  71.         },
  72.     }
  73. };
  74.  
  75. resource 'inpk' (300) {
  76.     format0 {
  77.         showsOnCustom,
  78.         removable,
  79.         dontForceRestart,
  80.         0,
  81.         0,
  82.         "Folder Merge with Custom Icon",
  83.         {    
  84.         'infm', 3000;
  85.         },
  86.     }
  87. };
  88.  
  89.  
  90. // • folder merge atoms
  91.  
  92. // folder atom that installs all files within source folder
  93. // to ":Folder Merge Example:" folder on target volume
  94. resource 'infm' (1000) {
  95.     format0{
  96.         0,                            // folder size
  97.         10001,                        // target spec
  98.         10000,                         // source spec
  99.         "TeachText • folder1"        // description
  100.     };
  101. };
  102.  
  103.  
  104. // folder atom that installs all files within source folder
  105. // to user selected folder on target volume
  106. resource 'infm' (2000) {
  107.     format0{
  108.         0,                            // folder size
  109.         20001,                        // target spec
  110.         20000,                         // source spec 
  111.         "TeachText • folder2"        // description
  112.     };
  113. };
  114.  
  115.  
  116.  
  117. // folder atom that installs all files within source folder
  118. // to ":Folder Custom Icon Example:" folder on target volume
  119. //
  120. //    EXPLANATION OF CUSTOM ICON FILE: A custom icon can be 
  121. //    added to the source folder by performing a GetInfo on
  122. //    the source folder from the Finder. In the upper left 
  123. //    hand corner of the GetInfo dialog there is a place that
  124. //    icons can be copied from and pasted to. If a folder has
  125. //    a Custom Icon, that icon will appear as an invisible file
  126. //    within the folder. The icon will have the filename of "icon\n".
  127. //
  128. //    NOTE: As of Installer 4.0.3 the Custom Icon installation
  129. //    is broken. The problem is that the "Custom Icon" bit
  130. //    for the Finder Attributes flags for the target folder is not
  131. //    being set correctly.  An 'after' Action Atom can be used to 
  132. //    work around this bug.  Contact DTS (AL: DEV.SUPPORT) for more
  133. //    information.
  134.  
  135. resource 'infm' (3000) {
  136.     format0{
  137.         0,                            // folder size
  138.         30001,                        // target spec
  139.         30000,                         // source spec 
  140.         "TeachText • folder3"        // description
  141.     };
  142. };
  143.  
  144.  
  145. // • source and target specs
  146.  
  147. // target file spec for folder merge atom
  148. resource 'intf' (10001) {
  149.     format1 {
  150.         noSearchForFile,                 // use default search path
  151.         0,                                 // ignored in folder merge atoms
  152.         0,                                 // ignored in folder merge atoms
  153.         0,                                 // ignored in folder merge atoms
  154.         0,                                 // ignored in folder merge atoms
  155.         0,                                  // ignored in folder merge atoms
  156.         0,                                  // ignored in folder merge atoms
  157.         0,                                 // search proc ID ( 'insp' ), none used
  158.         ":FolderMerge Example:"            // path to target folder
  159.         }
  160.     };
  161.  
  162. // source file spec for folder merge atom
  163. resource 'infs' (10000) {
  164.     'APPL',                        // ignored in folder merge atoms
  165.     'ttxt',                        // ignored in folder merge atoms
  166.     0x1,                        // ignored in folder merge atoms
  167.     noSearchForFile,            // ignored in folder merge atoms
  168.     TypeCrMustMatch,            // ignored in folder merge atoms
  169.     "Disk 1:folder1:"            // path to source folder            
  170. };
  171.  
  172. // target file spec for folder merge atom
  173. resource 'intf' (20001) {
  174.     format1 {
  175.         noSearchForFile,                 // use default search path
  176.         0,                                 // ignored in folder merge atoms
  177.         0,                                 // ignored in folder merge atoms
  178.         0,                                 // ignored in folder merge atoms
  179.         0,                                 // ignored in folder merge atoms
  180.         0,                                  // ignored in folder merge atoms
  181.         0,                                  // ignored in folder merge atoms
  182.         0,                                 // search proc ID ( 'insp' ), none used
  183.         "folder-user:"                    // path to target folder
  184.         }
  185.     };
  186.  
  187. // source file spec for folder merge atom
  188. resource 'infs' (20000) {
  189.     'APPL',                        // ignored in folder merge atoms
  190.     'ttxt',                        // ignored in folder merge atoms
  191.     0x1,                        // ignored in folder merge atoms
  192.     noSearchForFile,            // ignored in folder merge atoms
  193.     TypeCrMustMatch,            // ignored in folder merge atoms
  194.     "Disk 1:folder2:"            // path to source folder            
  195. };
  196.  
  197. // target file spec for folder merge atom
  198. resource 'intf' (30001) {
  199.     format1 {
  200.         noSearchForFile,                 // use default search path
  201.         0,                                 // ignored in folder merge atoms
  202.         0,                                 // ignored in folder merge atoms
  203.         0,                                 // ignored in folder merge atoms
  204.         0,                                 // ignored in folder merge atoms
  205.         0,                                  // ignored in folder merge atoms
  206.         0,                                  // ignored in folder merge atoms
  207.         0,                                 // search proc ID ( 'insp' ), none used
  208.         ":Folder Custom Icon Example:"    // path to target folder        
  209.         }
  210.     };
  211.  
  212.  
  213. // source file spec for folder merge atom
  214. resource 'infs' (30000) {
  215.     'APPL',                        // ignored in folder merge atoms
  216.     'ttxt',                        // ignored in folder merge atoms
  217.     0x1,                        // ignored in folder merge atoms
  218.     noSearchForFile,            // ignored in folder merge atoms
  219.     TypeCrMustMatch,            // ignored in folder merge atoms
  220.     "Disk 1:folder3:"            // path to source folder            
  221. };
  222.  
  223.  
  224.  
  225. resource 'inpr' ( 300 ) {
  226.     format0{
  227.         useFolderTargetMode,            // allow user to select target folder
  228.                                         // instead of only choosing target volume
  229.                                         
  230.         dontAllowUserToSetSystemDisk,    // don't allow user to override default
  231.                                         // volume as destination for system files
  232.                                         
  233.         showSelectedSizeInCustom,        // show user how much disk space will be
  234.                                         // required for installation of selected files
  235.                                         
  236.         noSetupFUnctionSupplied,        // not using a setup function code resource
  237.         
  238.         allowCleanInstall,                // if user pressed CTRL/SHFT/K then a copy of
  239.                                         // System Folder will be created and System files
  240.                                         // will always be installed to a new folder
  241.                                         
  242.         dontAllowServerAsTarget,        // don't allow user to install to 
  243.                                         // an Apple Share volume or server
  244.     
  245.         '',                                // setup function type ( none supplied )
  246.         0,                                // setup function code rsrc ID ( none supplied )
  247.         {
  248.             
  249.             // help page #1
  250.             301,                    // B/W • resource ID of 'PICT' item
  251.             311,                    // B/W • resource ID of 'TEXT' item
  252.             301,                    // 8-Bit Color • resource ID of 'PICT' item
  253.             311,                    // 8-Bit Color • resource ID of 'PICT' item
  254.             
  255.             // help page #2
  256.             302,                    // B/W • resource ID of 'PICT' item
  257.             312,                    // B/W • resource ID of 'TEXT' item
  258.             302,                    // 8-Bit Color • resource ID of 'PICT' item
  259.             312,                    // 8-Bit Color • resource ID of 'PICT' item
  260.             
  261.         },
  262.         "Sample Folder"
  263.     }
  264.  
  265. };
  266.  
  267.  
  268.  
  269.